--################# Recieve Notify @KP3/Prefanatic
function RecieveNotify(UCMD)
	surface.SetFont("NotifyFont")
    NotifyMessage = UCMD:ReadString()
	NotifyTime = UCMD:ReadShort()
	NotifyDeath = UCMD:ReadBool() if NotifyDeath then NoteDeath = "and is dead!" else NoteDeath = "and isn't dead!" end
	local Time = CurTime()
	local Fade = 0.5
	
	print("Recieved notification!  Message: " .. NotifyMessage .. " Time up: " .. NotifyTime .. " " .. NoteDeath)
	
	local function DisplayNotify()	
		local alpha = 255
		local DoomTime = CurTime() - Time
		
		if DoomTime > NotifyTime then 
			hook.Remove( "HUDPaint", "NotifyDraw" )	
			ResetNotify()
			return
		end
		
		if Fade - DoomTime > 0 then
			alpha = (Fade - DoomTime) / Fade
			alpha = 1 - alpha
			alpha = alpha * 255
		end
		
		if NotifyTime - DoomTime < Fade then 
			alpha = (NotifyTime - DoomTime) / Fade
			alpha = alpha * 255
		end		
		alpha = alpha
		
		draw.RoundedBox(6, (ScrW() / 2) - (((string.len(NotifyMessage) * FontResize) * 18) / 2), ScrH() / 2 - 350, (string.len(NotifyMessage) * FontResize) * 18, 50, Color(0, 0, 0, alpha / 2))
		
		draw.DrawText(NotifyMessage, "NotifyFont", ScrW() / 2, ScrH() / 2 - 335, Color(255,255,255,alpha), 1) 
	
	end
	
	hook.Add("HUDPaint", "NotifyDraw", DisplayNotify)
end
usermessage.Hook("_Notify", RecieveNotify)

--################# Reset Notify Vars @Prefanatic
function ResetNotify()
	NotifyMessage = ""
	NotifyTime = 0
	DoomTime = 0
end

